package com.example.blog.controller;

import com.example.blog.service.UploadService;
import com.example.blog.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

@RestController
@RequestMapping("/uploads")
public class UploadController {
    @Autowired
    private UploadService uploadService;
    @PostMapping
    public Result imageUpload(MultipartFile file){
        System.out.println(file.toString());
        return uploadService.imageUpload(file);
    }
}
